Skip to content

fix(parser): braced /{E1, E2} return-position effect row (Refs #59)#197

Merged
hyperpolymath merged 1 commit into
mainfrom
stage-b/braced-effect-row
May 18, 2026
Merged

fix(parser): braced /{E1, E2} return-position effect row (Refs #59)#197
hyperpolymath merged 1 commit into
mainfrom
stage-b/braced-effect-row

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Root cause

The effects-migration-stance guide uses /{IO} and /{IO, Async} verbatim as the migrator-facing syntax, but the grammar only parsed the bare single-term -> T / E (ADR-008) and the prefix -{ E1 + E2 }-> row. So migrators could not write the documented syntax — flagged as out-of-scope follow-up in PR-1 (#196).

Change (PR-2 of STAGE-B)

Adds one return_type production: ARROW type_expr SLASH LBRACE separated_nonempty_list(COMMA, effect_term) RBRACE, folded into the binary EffUnion AST via a new effect_union_of_list header helper.

The SLASH LBRACE prefix is unambiguous: the bare form continues on IDENT, the prefix row uses MINUS LBRACE, and { cannot open a division operand in type position.

Verification

  • Conflict states unchanged: 25 s/r, 5 r/r (the documented ADR-008/ADR-009 permissive-ambiguity class). The 35→36 arbitrarily-resolved r/r item is exactly what the ADR-008 grammar note predicts for adding any SLASH production.
  • dune build clean; dune test --force 253/253, zero regression.
  • Behaviour: /{IO} and /{IO, Async} now parse + typecheck; /{IO, Bogus} still rejected via the PR-1 registry (validation flows through the new form); bare /IO unregressed.

Refs #59

The effects-migration-stance guide uses /{IO} and /{IO, Async} verbatim,
but only the bare single-term `-> T / E` and prefix `-{ E1 + E2 }->`
forms parsed; migrators could not write the documented syntax.

Adds `ARROW type_expr SLASH LBRACE sep_nonempty_list(COMMA, effect_term)
RBRACE`, folded into EffUnion via effect_union_of_list. The SLASH LBRACE
prefix is unambiguous (bare form continues on IDENT; prefix row uses
MINUS LBRACE; `{` cannot open a division operand in type position).

Conflict STATES unchanged (25 s/r, 5 r/r — the documented ADR-008/009
permissive class); the 35->36 r/r item is exactly what the ADR-008
note predicts for any SLASH production. dune test 253/253, zero
regression. Verified: /{IO} and /{IO, Async} parse+typecheck, /{IO,
Bogus} still rejected via the PR-1 registry, bare /IO unregressed.

Refs #59

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 8f3e156 into main May 18, 2026
11 of 12 checks passed
@hyperpolymath hyperpolymath deleted the stage-b/braced-effect-row branch May 18, 2026 06:50
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 44 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stray AI.a2ml in root -- use 0-AI-MANIFEST.a2ml only",
    "type": "banned",
    "file": "AI.a2ml",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Superseded by 0-AI-MANIFEST.a2ml",
    "type": "banned",
    "file": "AI.djot",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/example/smoke_driver.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/cli.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/runner.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant